oracle.pgx.api

## Class ServerInstance

- java.lang.Object
- - oracle.pgx.api.ServerInstance

-     public class ServerInstance
      extends Object

  A PGX server instance.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPinnedGraph(GraphConfig cfg)` Blocking version of `#addPinnedGraphAsync()`.
    `PgxFuture<Void>` | `addPinnedGraphAsync(GraphConfig cfg)` Add a pinned graph (will not be unloaded by engine) to be shared between sessions
    `PgxSession` | `createSession(String source)` Blocking version of `#createSessionAsync()`.
    `PgxSession` | `createSession(String source, Long idleTimeout, Long taskTimeout, TimeUnit unit)` Blocking version of `#createSessionAsync()`.
    `PgxFuture<PgxSession>` | `createSessionAsync(String source)` Create a new session.
    `PgxFuture<PgxSession>` | `createSessionAsync(String source, Long idleTimeout, Long taskTimeout, TimeUnit unit)` Creates a new session.
    `void` | `demotePinnedGraph(GraphConfig cfg)` Blocking version of `#demotePinnedGraphAsync()`.
    `PgxFuture<Void>` | `demotePinnedGraphAsync(GraphConfig cfg)` Demote pinned graph.
    `String` | `getBaseUrl()` Gets the base url this instance object is pointing to.
    `GraphInfo` | `getGraphInfo(String graphName)` Blocking version of `#getGraphInfoAsync()`.
    `GraphInfo` | `getGraphInfo(String sessionId, String graphName)` Blocking version of `#getGraphInfoAsync()`.
    `PgxFuture<GraphInfo>` | `getGraphInfoAsync(String graphName)` Get details of a (shared) persistent graph
    `PgxFuture<GraphInfo>` | `getGraphInfoAsync(String sessionId, String graphName)` Get details of a session-bound, private graph
    `Collection<GraphInfo>` | `getGraphInfos()` Blocking version of `getGraphInfosAsync()`.
    `PgxFuture<Collection<GraphInfo>>` | `getGraphInfosAsync()` Get a list of currently active graphs.
    `MemoryInfo` | `getMemoryInfo()` Blocking version of `getMemoryInfoAsync()`.
    `PgxFuture<MemoryInfo>` | `getMemoryInfoAsync()` Gets the memory info.
    `Map<PgxConfig.Field,Object>` | `getPgxConfig()` Blocking version of `getPgxConfigAsync()`.
    `PgxFuture<Map<PgxConfig.Field,Object>>` | `getPgxConfigAsync()` Gets the PGX config.
    `String` | `getPgxVersion()` Gets the PGX version.
    `Integer` | `getPrefetchSize()` Gets the prefetchSize of this instance.
    `Integer` | `getRemoteFutureTimeout()` Gets the remoteFutureTimeout of this instance.
    `SessionInfo` | `getSessionInfo(String sessionId)` Blocking version of `#getSessionInfoAsync()`.
    `PgxFuture<SessionInfo>` | `getSessionInfoAsync(String sessionId)` Gets the session info.
    `Collection<SessionInfo>` | `getSessionInfos()` Blocking version of `getSessionInfosAsync()`.
    `PgxFuture<Collection<SessionInfo>>` | `getSessionInfosAsync()` Gets the session infos.
    `PoolInfo` | `getThreadPoolInfo(PoolType type)` Blocking version of `#getThreadPoolInfoAsync()`.
    `PgxFuture<PoolInfo>` | `getThreadPoolInfoAsync(PoolType type)` Gets the thread pool info.
    `Integer` | `getUploadBatchSize()` Gets the uploadBatchSize of this instance.
    `boolean` | `isEmbeddedInstance()` Checks if is embedded instance.
    `boolean` | `isEngineRunning()` Blocking version of `isEngineRunningAsync()`.
    `PgxFuture<Boolean>` | `isEngineRunningAsync()` Check if the engine is currently up
    `void` | `killSession(String sessionId)` Blocking version of `#killSessionAsync()`.
    `PgxFuture<Void>` | `killSessionAsync(String sessionId)` Kill a session.
    `GraphConfig` | `lookupPreloadedGraph(String name)` Blocking version of `#lookupPreloadedGraphAsync()`.
    `PgxFuture<GraphConfig>` | `lookupPreloadedGraphAsync(String name)` Looks up the config of a pre-loaded graph by name.
    `void` | `resizePool(PoolType poolType, int parallelism)` Blocking version of `#resizePoolAsync()`.
    `PgxFuture<Void>` | `resizePoolAsync(PoolType poolType, int parallelism)` Resize a pool to use a different degree of parallelism
    `boolean` | `shutdownEngine(long timeout, TimeUnit unit)` Blocking version of `#shutdownEngineAsync()`.
    `PgxFuture<Boolean>` | `shutdownEngineAsync(long timeout, TimeUnit unit)` Gracefully shuts down the engine and cleans up resources.
    `void` | `shutdownEngineNow()` Blocking version of `shutdownEngineNowAsync()`.
    `PgxFuture<Void>` | `shutdownEngineNowAsync()` Forces the engine to stop and clean up resources.
    `void` | `shutdownEngineNowIfRunning()` Blocking version of `shutdownEngineNowIfRunningAsync()`.
    `PgxFuture<Void>` | `shutdownEngineNowIfRunningAsync()` If the engine is currently up forces it to stop and clean up resources.
    `void` | `startEngine()` Blocking version of `startEngineAsync()`.
    `void` | `startEngine(InputStream config)` Blocking version of `startEngineAsync(InputStream)`.
    `void` | `startEngine(Map<PgxConfig.Field,Object> config)` Blocking version of `startEngineAsync(Map)`.
    `void` | `startEngine(String json)` Blocking version of `startEngineAsync()`.
    `PgxFuture<Void>` | `startEngineAsync()` Starts the PGX engine.
    `PgxFuture<Void>` | `startEngineAsync(InputStream config)` Starts the PGX engine with a custom configuration.
    `PgxFuture<Void>` | `startEngineAsync(Map<PgxConfig.Field,Object> config)` Starts the PGX engine with a custom configuration.
    `PgxFuture<Void>` | `startEngineAsync(String path)` Starts the PGX engine with a custom configuration given as path.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### addPinnedGraph

          @Generated(value="src/python/synchronize.py")
          public void addPinnedGraph(GraphConfig cfg)
                              throws ExecutionException,
                                     InterruptedException

      Blocking version of `#addPinnedGraphAsync()`. Calls `#addPinnedGraphAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### addPinnedGraphAsync

          public PgxFuture<Void> addPinnedGraphAsync(GraphConfig cfg)

      Add a pinned graph (will not be unloaded by engine) to be shared between sessions
      Parameters:
        `cfg` -

    - #### createSession

          @Generated(value="src/python/synchronize.py")
          public PgxSession createSession(String source)
                                   throws ExecutionException,
                                          InterruptedException

      Blocking version of `#createSessionAsync()`. Calls `#createSessionAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### createSession

          @Generated(value="src/python/synchronize.py")
          public PgxSession createSession(String source,
                                                Long idleTimeout,
                                                Long taskTimeout,
                                                TimeUnit unit)
                                   throws ExecutionException,
                                          InterruptedException

      Blocking version of `#createSessionAsync()`. Calls `#createSessionAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### createSessionAsync

          public PgxFuture<PgxSession> createSessionAsync(String source)

      Create a new session.
      Parameters:
        `source` - a descriptive string identifying the client
      Returns:
        created session

    - #### createSessionAsync

          public PgxFuture<PgxSession> createSessionAsync(String source,
                                                 Long idleTimeout,
                                                 Long taskTimeout,
                                                 TimeUnit unit)

      Creates a new session.
      Parameters:
        `source` - a descriptive string identifying the client
        `idleTimeout` - if not `null`, tries to overwrite server default idle timeout
        `taskTimeout` - if not `null`, tries to overwrite server default task timeout
        `unit` - time unit of idleTimeout and taskTimeout
      Returns:
        created session

    - #### demotePinnedGraph

          @Generated(value="src/python/synchronize.py")
          public void demotePinnedGraph(GraphConfig cfg)
                                 throws ExecutionException,
                                        InterruptedException

      Blocking version of `#demotePinnedGraphAsync()`. Calls `#demotePinnedGraphAsync()` and waits for returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### demotePinnedGraphAsync

          public PgxFuture<Void> demotePinnedGraphAsync(GraphConfig cfg)

      Demote pinned graph.
      Parameters:
        `cfg` - the cfg

    - #### getBaseUrl

          public String getBaseUrl()

      Gets the base url this instance object is pointing to.
      Returns:
        base url

    - #### getGraphInfo

          @Generated(value="src/python/synchronize.py")
          public GraphInfo getGraphInfo(String graphName)
                                 throws ExecutionException,
                                        InterruptedException

      Blocking version of `#getGraphInfoAsync()`. Calls `#getGraphInfoAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### getGraphInfo

          @Generated(value="src/python/synchronize.py")
          public GraphInfo getGraphInfo(String sessionId,
                                              String graphName)
                                 throws ExecutionException,
                                        InterruptedException

      Blocking version of `#getGraphInfoAsync()`. Calls `#getGraphInfoAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### getGraphInfoAsync

          public PgxFuture<GraphInfo> getGraphInfoAsync(String graphName)

      Get details of a (shared) persistent graph
      Parameters:
        `graphName` - internal name of persistent graph
      Returns:
        details of one specific graph

    - #### getGraphInfoAsync

          public PgxFuture<GraphInfo> getGraphInfoAsync(String sessionId,
                                               String graphName)

      Get details of a session-bound, private graph
      Parameters:
        `sessionId` - session id of session holding the graph
        `graphName` - name of graph
      Returns:
        details of one specific graph

    - #### getGraphInfos

          @Generated(value="src/python/synchronize.py")
          public Collection<GraphInfo> getGraphInfos()
                                              throws ExecutionException,
                                                     InterruptedException

      Blocking version of `getGraphInfosAsync()`. Calls `getGraphInfosAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### getGraphInfosAsync

          public PgxFuture<Collection<GraphInfo>> getGraphInfosAsync()

      Get a list of currently active graphs.
      Returns:
        a list of currently active graphs

    - #### getMemoryInfo

          @Generated(value="src/python/synchronize.py")
          public MemoryInfo getMemoryInfo()
                                   throws ExecutionException,
                                          InterruptedException

      Blocking version of `getMemoryInfoAsync()`. Calls `getMemoryInfoAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### getMemoryInfoAsync

          public PgxFuture<MemoryInfo> getMemoryInfoAsync()

      Gets the memory info.
      Returns:
        current memory usage statistics

    - #### getPgxConfig

          @Generated(value="src/python/synchronize.py")
          public Map<PgxConfig.Field,Object> getPgxConfig()
                                                   throws ExecutionException,
                                                          InterruptedException

      Blocking version of `getPgxConfigAsync()`. Calls `getPgxConfigAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### getPgxConfigAsync

          public PgxFuture<Map<PgxConfig.Field,Object>> getPgxConfigAsync()

      Gets the PGX config.
      Returns:
        current PGX server configuration as JSON string

    - #### getPgxVersion

          public String getPgxVersion()

      Gets the PGX version.
      Returns:
        string identifying this PGX version

    - #### getPrefetchSize

          public Integer getPrefetchSize()

      Gets the prefetchSize of this instance. Note that prefetchSize is ignored if this instance is an embedded instance (`isEmbeddedInstance()`).
      Returns:
        the prefetchSize.

    - #### getRemoteFutureTimeout

          public Integer getRemoteFutureTimeout()

      Gets the remoteFutureTimeout of this instance. Note that remoteFutureTimeout is ignored if this instance is an embedded instance (`isEmbeddedInstance()`).
      Returns:
        the remoteFutureTimeout.

    - #### getSessionInfo

          @Generated(value="src/python/synchronize.py")
          public SessionInfo getSessionInfo(String sessionId)
                                     throws ExecutionException,
                                            InterruptedException

      Blocking version of `#getSessionInfoAsync()`. Calls `#getSessionInfoAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### getSessionInfoAsync

          public PgxFuture<SessionInfo> getSessionInfoAsync(String sessionId)

      Gets the session info.
      Parameters:
        `sessionId` - the session id
      Returns:
        details of one specific session

    - #### getSessionInfos

          @Generated(value="src/python/synchronize.py")
          public Collection<SessionInfo> getSessionInfos()
                                                  throws ExecutionException,
                                                         InterruptedException

      Blocking version of `getSessionInfosAsync()`. Calls `getSessionInfosAsync()` and waits for returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### getSessionInfosAsync

          public PgxFuture<Collection<SessionInfo>> getSessionInfosAsync()

      Gets the session infos.
      Returns:
        a list of currently active sessions

    - #### getThreadPoolInfo

          @Generated(value="src/python/synchronize.py")
          public PoolInfo getThreadPoolInfo(PoolType type)
                                     throws ExecutionException,
                                            InterruptedException

      Blocking version of `#getThreadPoolInfoAsync()`. Calls `#getThreadPoolInfoAsync()` and waits for returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### getThreadPoolInfoAsync

          public PgxFuture<PoolInfo> getThreadPoolInfoAsync(PoolType type)

      Gets the thread pool info.
      Parameters:
        `type` - which thread pool
      Returns:
        thread pool statistics

    - #### getUploadBatchSize

          public Integer getUploadBatchSize()

      Gets the uploadBatchSize of this instance. Note that uploadBatchSize is ignored if this instance is an embedded instance (`isEmbeddedInstance()`).
      Returns:
        the uploadBatchSize.

    - #### isEmbeddedInstance

          public boolean isEmbeddedInstance()

      Checks if is embedded instance.
      Returns:
        true, if is embedded instance

    - #### isEngineRunning

          @Generated(value="src/python/synchronize.py")
          public boolean isEngineRunning()
                                  throws ExecutionException,
                                         InterruptedException

      Blocking version of `isEngineRunningAsync()`. Calls `isEngineRunningAsync()` and waits for returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### isEngineRunningAsync

          public PgxFuture<Boolean> isEngineRunningAsync()

      Check if the engine is currently up
      Returns:
        true if engine is currently running, false otherwise

    - #### killSession

          @Generated(value="src/python/synchronize.py")
          public void killSession(String sessionId)
                           throws ExecutionException,
                                  InterruptedException

      Blocking version of `#killSessionAsync()`. Calls `#killSessionAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### killSessionAsync

          public PgxFuture<Void> killSessionAsync(String sessionId)

      Kill a session.
      Parameters:
        `sessionId` - the session to be killed

    - #### lookupPreloadedGraph

          @Generated(value="src/python/synchronize.py")
          public GraphConfig lookupPreloadedGraph(String name)
                                           throws ExecutionException,
                                                  InterruptedException

      Blocking version of `#lookupPreloadedGraphAsync()`. Calls `#lookupPreloadedGraphAsync()` and waits for returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### lookupPreloadedGraphAsync

          public PgxFuture<GraphConfig> lookupPreloadedGraphAsync(String name)

      Looks up the config of a pre-loaded graph by name.
      Parameters:
        `name` - the name of the graph
      Returns:
        the graph config of the pre-loaded graph, `null` if no such graph was pre-loaded.

    - #### resizePool

          @Generated(value="src/python/synchronize.py")
          public void resizePool(PoolType poolType,
                                       int parallelism)
                          throws ExecutionException,
                                 InterruptedException

      Blocking version of `#resizePoolAsync()`. Calls `#resizePoolAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### resizePoolAsync

          public PgxFuture<Void> resizePoolAsync(PoolType poolType,
                                        int parallelism)

      Resize a pool to use a different degree of parallelism
      Parameters:
        `poolType` - which pool to resize
        `parallelism` - the target parallelism

    - #### shutdownEngine

          @Generated(value="src/python/synchronize.py")
          public boolean shutdownEngine(long timeout,
                                              TimeUnit unit)
                                 throws ExecutionException,
                                        InterruptedException

      Blocking version of `#shutdownEngineAsync()`. Calls `#shutdownEngineAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### shutdownEngineAsync

          public PgxFuture<Boolean> shutdownEngineAsync(long timeout,
                                               TimeUnit unit)

      Gracefully shuts down the engine and cleans up resources. All currently enqueued tasks will be worked off prior shut down, new incoming requests get rejected. This call blocks until shut down is complete or timed out.
      Returns:
        true if gracefully shut down. false if timed out before shut down.

    - #### shutdownEngineNow

          @Generated(value="src/python/synchronize.py")
          public void shutdownEngineNow()
                                 throws ExecutionException,
                                        InterruptedException

      Blocking version of `shutdownEngineNowAsync()`. Calls `shutdownEngineNowAsync()` and waits for returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### shutdownEngineNowAsync

          public PgxFuture<Void> shutdownEngineNowAsync()

      Forces the engine to stop and clean up resources. Currently running tasks are interrupted. New incoming requests get rejected.
      Throws an exception when current tasks didn't finish after a short grace period.

    - #### shutdownEngineNowIfRunning

          @Generated(value="src/python/synchronize.py")
          public void shutdownEngineNowIfRunning()
                                          throws ExecutionException,
                                                 InterruptedException

      Blocking version of `shutdownEngineNowIfRunningAsync()`. Calls `shutdownEngineNowIfRunningAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### shutdownEngineNowIfRunningAsync

          public PgxFuture<Void> shutdownEngineNowIfRunningAsync()

      If the engine is currently up forces it to stop and clean up resources. Currently running tasks are interrupted. New incoming requests get rejected.

    - #### startEngine

          @Generated(value="src/python/synchronize.py")
          public void startEngine()
                           throws ExecutionException,
                                  InterruptedException

      Blocking version of `startEngineAsync()`. Calls `startEngineAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### startEngine

          @Generated(value="src/python/synchronize.py")
          public void startEngine(InputStream config)
                           throws ExecutionException,
                                  InterruptedException

      Blocking version of `startEngineAsync(InputStream)`. Calls `startEngineAsync(InputStream)` and waits for returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### startEngine

          @Generated(value="src/python/synchronize.py")
          public void startEngine(Map<PgxConfig.Field,Object> config)
                           throws ExecutionException,
                                  InterruptedException

      Blocking version of `startEngineAsync(Map)`. Calls `startEngineAsync(Map)` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### startEngine

          @Generated(value="src/python/synchronize.py")
          public void startEngine(String json)
                           throws ExecutionException,
                                  InterruptedException

      Blocking version of `startEngineAsync()`. Calls `startEngineAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### startEngineAsync

          public PgxFuture<Void> startEngineAsync()

      Starts the PGX engine.

    - #### startEngineAsync

          public PgxFuture<Void> startEngineAsync(InputStream config)

      Starts the PGX engine with a custom configuration.
      Parameters:
        `config` - the config

    - #### startEngineAsync

          public PgxFuture<Void> startEngineAsync(Map<PgxConfig.Field,Object> config)

      Starts the PGX engine with a custom configuration.
      Parameters:
        `config` - the config

    - #### startEngineAsync

          public PgxFuture<Void> startEngineAsync(String path)

      Starts the PGX engine with a custom configuration given as path.
      Parameters:
        `path` - the path may be prefixed with resource handlers. See `Protocol`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2015. All rights reserved.